﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace ServicesDirectory
{
    public partial class TestPopupThinhDV : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            btnListContact.Click += ListContact_Click;
            btnLookupBusiness.Click += LookupBusiness_Click;
            btnManagerContact.Click += ManagerContact_Click;
            LookupBusinessType1.CloseControl += LookupBusinessType1_CloseControl;
            LookupBusinessType1.GetBusiness += LookupBusinessType1_GetBusiness;
            ListContact1.CloseControl += ListContact1_CloseControl;
            ListContact1.GetContactId += ListContact1_GetContactId;
            ManagerContact1.CloseControl += ManagerContact1_CloseControl;
            btnMesagebox.Click += BtnMesagebox_Click;
            MessageBox1.Yes += MessageBox1_Yes;
            MessageBox1.No += MessageBox1_No;
        }

        void MessageBox1_No(object sender, EventArgs e)
        {
            lblResult.Text = "No"; Panel1.Visible = false;
        }

        void MessageBox1_Yes(object sender, EventArgs e)
        {
            lblResult.Text = "Yes"; Panel1.Visible = false;
        }

        void BtnMesagebox_Click(object sender, EventArgs e)
        {
            Panel1.Visible = true;
            MessageBox1.SetTitle("du lieu demo",4);
        }

        void ListContact1_GetContactId(object sender, EventArgs e)
        {
            if(sender!=null)
            lblResult.Text = sender.ToString();
        }

        void ListContact1_CloseControl(object sender, EventArgs e)
        {
            plListContact.Visible = false;
        }

        void ManagerContact1_CloseControl(object sender, EventArgs e)
        {
            plManagerContact.Visible = false;
        }

        void LookupBusinessType1_GetBusiness(object sender, EventArgs e)
        {
            if (sender != null)
            lblResult.Text = sender.ToString();
        }

        void LookupBusinessType1_CloseControl(object sender, EventArgs e)
        {
            plLookupBusiness.Visible = false;
        }

        void ManagerContact_Click(object sender, EventArgs e)
        {
            plManagerContact.Visible = true;
        }

        void LookupBusiness_Click(object sender, EventArgs e)
        {
            plLookupBusiness.Visible = true;
        }

        void ListContact_Click(object sender, EventArgs e)
        {
            plListContact.Visible = true;
        }
    }
}
